#ifdef __cplusplus
extern "C"
{
#endif

#include <libavutil/opt.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>

#ifdef __cplusplus
};
#endif

#include "sct/decode/decodeinterface.h"

#include "sct/core/common.h"
#include "sct/decode/videodec.h"
#include "sct/decode/audiodec.h"

namespace sct
{

CDecodeInterface* CDecodeInterface::create(const char * name, const CodecType codecType)
{
	std:: string n = name;

	if("decode" == n)
	{
		SCT_LOGD("create decode");
		switch(codecType)
		{
		case CT_H264:
		{
			return new CVideoDec(codecType);
			break;
		}

		case CT_AAC:
		{
			return new CAudioDec(codecType);
			break;
		}

		default:
		{
			SCT_LOGD();
			break;
		}
		}
	}

	return new CDecodeInterface(codecType);
}

void CDecodeInterface::initlib()
{
	avcodec_register_all();
}

}
